﻿using System;
using log4net;

namespace EvincePayroll.Utility
{
    public class LogEngine
    {
        protected static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);


        public static void Log(string message)
        {
            log4net.Config.XmlConfigurator.Configure();
            log.Error(message);
        }

        public static void Log(Exception ex)
        {
            log4net.Config.XmlConfigurator.Configure();
            log.Error(ex);
        }

        public static void Log(string message, Exception ex)
        {
            log4net.Config.XmlConfigurator.Configure();
            log.Error(message, ex);
        }

        public static void LogInfo(string message)
        {
            string t = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString();
            log4net.Config.XmlConfigurator.Configure();            
            log.Info(message);
        }
    }
}
